/**
 * Created with JetBrains WebStorm.
 * User: Administrator
 * Date: 13-6-7
 * Time: 上午11:26
 * To change this template use File | Settings | File Templates.
 */
Ext.define('cloud.view.message.MessageAdd', {
    extend: 'Ext.form.FormPanel',
    xtype: 'messageadd',

    requires: ['Ext.form.Panel', 'Ext.form.FieldSet', 'Ext.field.Toggle', 'Ext.field.Select', 'Ext.ux.Fileup', 'Ext.Img'],
    config: {
        title: '添加用户留言',
        items: [
            {
                xtype: 'toolbar',
                docked: 'bottom',
                layout: {
                    type: 'hbox',
                    pack: 'end'
                },
                items: [
                    {
                        id: 'message_submit',
                        iconMask: true,
                        scope: this,
                        text: '提交',
                        cls:'x-button2',
                        style: 'align:center'
                    }
                ]
            },
            {
                xtype: 'fieldset',

                defaults: {
                    labelwidth: '20%',
                    xtype: 'textfield',
                    required: true,
                    clearIcon: true
                },
                items: [
                    {
                        xtype: 'selectfield',
                        store: 'UsersAllFindStore',
                        id: 'message_cuid',
                        name: 'cuid',
                        label: '用户ID',
                        displayField: 'cuid',
                        valueField: 'cuid'
                    },
                    {
                        xtype: 'selectfield',
                        store: 'AreaAllFindStore',
                        id: 'message_cadid',
                        name: 'cadid',
                        label: '所在开通地区ID',
                        displayField: 'name',
                        valueField: 'cadid',
                        listeners: {
                            initialize: function () {
                                var caid = localStorage.getItem('caid');
                                var store = Ext.getStore('AreaAllFindStore');
                                store.filter('status',1, true);
                                store.load({params: {caid: caid}});
                            }
                        }
                    },
                    {
                        id: 'message_messages',
                        name: 'messages',
                        label: '留言内容',
                        maxLength: 50,
                        placeHolder: '请输入留言内容'
                    },
                    {
                        id: 'message_mestype',
                        name: 'mesType',
                        label: '留言类型',
                        maxLength: 50,
                        hidden: true,
                        value: '文字'
                    }

                ]

            }
        ]
    }
});